package edu.ccut.saturn.studio.logic;

import edu.ccut.saturn.studio.core.util.wizard.SaturnWizard;
import edu.ccut.saturn.studio.logic.model.saturn.logic.SaturnStartNodeInLogic;

public class LogicWizard extends SaturnWizard {

	@Override
	public void addPages() {
		addPage(new LogicWizardPage());
	}

	@Override
	protected String getEditorID() {
		return LogicEditor.ID;
	}

	@Override
	protected String getFileName() {
		return super.getValues().get(LogicWizardPage.LOGIC_WIZARD_FILE_NAME)
				+ ".logic";
	}

	@Override
	protected String getTemplatePath() {
		Object shape = super.getValues().get(
				LogicWizardPage.TEMPLATE_SATURNCOMPONENT_NAME);

		if (shape != null) {
			if(shape instanceof SaturnStartNodeInLogic){
//			if (shape.getClass().getName().endsWith(".Logic")) {
				return "template/newlogicInNodeLogic.ftl";
			} else {
				return "template/newlogicInNodeComponent.ftl";
			}
		}

		return "template/newlogic.ftl";
	}
}
